﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo01
{
    //   定义一个员工类，存放用户的工号、姓名和部门信息；
    //定义两个构造函数，一个是无参；
    //一个有参构造函数，对类的属性进行初始化。
    class Program
    {
        static void Main(string[] args)
        {
            employee e1 = new employee();
            Console.WriteLine(e1);
            employee e2 = new employee(1, "nicola", "行政部");
            Console.WriteLine(e2);
            employee e3 = new employee() { EName = "rose"};
            Console.WriteLine(e3);
        }
    }
    class employee
    {
        private int _eNo;
        private string _eName;
        private string _eDepartment;


        public int ENo { get => _eNo; set => _eNo = value; }
        public string EName { get => _eName; set => _eName = value; }
        public string EDepartment { get => _eDepartment; set => _eDepartment = value; }

        public employee(int eNo, string eName, string eDepartment)
        {
            ENo = eNo;
            EName = eName;
            EDepartment = eDepartment;
        }

        public employee()
        {
        }

        public override string ToString()
        {
            return $"姓名:{this.EName},员工号:{this.ENo},部门:{this.EDepartment}";
        }
    }
}
